<css file="__PUBLIC__/index/css/index.css"/>
<js file="__PUBLIC__/jquery.js" />
<!DOCTYPE html>
<script>
    $(function(){
        var url = "__URL__";
        var nbsp = /^\s*|\s*$/ig;
        $('.username').blur(function(){
            var val = $(this).val();
            val = val.replace(nbsp,'');
            var reg = /@/ig;
            if(val!==''){
                if(!reg.exec(val)){
                    val += "@qq.com";
                    $(this).val(val);
                }
            }
        })
        $('.qq_btn').click(function(){
            var username = $('.username').val();
            var password = $('.password').val();
            username =username.replace(nbsp,'');
            //验证用户名是否为空
            if(username==''){
                $('.qq_error').html("你还没有输入帐号!").show();  
                return false;
            }
            var repg = /^\d{6,13}@(qq|QQ)\.(com|cn)/ig;
            //验证格式是否正确
            if(!repg.exec(username)){
                $('.qq_error').html("请输入正确的帐号!").show();
                return false;
            }
            $.post(url+'/qqver',{'qqname':username,'qqpassword':password},function(data){
                if(data.num==1){
                    $('form:first').submit();
                }else{
                    $('.qq_error').html("帐号或密码不正确").show();
                    return false;
                }
            },'json')

            
        })
    })
    
</script>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body style="background:#fff">
        <div class="qq_top">   
            <div class="qq_logo">
                <img src="__PUBLIC__/index/images/logo_login.png" />
                <a href="#"> 什么是QQ登录?</a>
            </div>
        </div>
        <div class="qq_enter">
            <p class="tishi">用QQ帐号登录<a href="__URL__/index">花瓣网</a>, 一键通行更轻松</p>
            <p class="qq_error"></p>
            <form action="__URL__/qqlogin" method="post">
                <input type="text" name="username" class="username p" placeholder="QQ号码/绑定的QQ号邮箱" autocomplete="off"/>
                <input type="password" name="password" class="password p" placeholder="密码" autocomplete="off"/>
            </form>
            <input type="button" value="提交" class="qq_btn" />
            <p class="lianji">
                <a href="#">忘记密码</a>
            </p>
        </div>
        <div class="qq_floor"></div>
    </body>
</html>
